var mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');

var schema = new mongoose.Schema({
    productId: mongoose.Schema.ObjectId,
    name: String,
    descript: String,
    photo: String,
    num: Number,
    sales: Number,
    firm: String,
    price: Number,
    selling: Number,
    deliverytime: Date
});
schema.plugin(mongoosePaginate);

module.exports = mongoose.model('Product', schema); // Model.paginate()